'''
The Place Order User Interface for the foodler workflow (Winter Intensives Lab 5)

This is where you define the fields that appear on the screen (application) the customer sees and tell WMP how this application (user interface) fits into the overall
workflow.


'''

# these next few lines import some of the WMP functions we will
# use in this file.
from frontend.roleApplication import RoleApplication
from frontend.form import Type

class PlaceOrderApplication(RoleApplication):

    def __init__(self):
        super(PlaceOrderApplication, self).__init__("EricHoldenFoodler", "Customer") # use actual work flow name and role name
        self.register_source_step("PlaceOrder", self.take_order_form_creator) # use actual name for this task

    def take_order_form_creator(self, stepname, form):
        form.add_field(Type.SHORTSTRING, "CustName", labeltext="Customer Name: ")
        
        form.add_field(Type.LONGSTRING, "CustAddress", labeltext="Customer Address: ")
        
        form.add_field(Type.CHOICE, "Rest", choices=['Popeyes', 'Snowdens', 'Smoking Joes', 'Breadwinners'], labeltext="Restaurant: ")
        
        form.add_field(Type.CHOICE, "Food", choices=['Fried Chicken', 'Hamburger', 'Cheeseburger', 'Pizza', 'Turkey Sandwich'], labeltext="Food Item: ")
        
        form.add_field(Type.INTEGER, "Quantity")
        # add at least two fields here, along with any additional static labels you need
        
if __name__ == '__main__':
    app = PlaceOrderApplication()
    app.MainLoop()